import {onMounted, ref} from "vue";
import axios from "axios";


export default function useShowDog(){
    const dogUrl = ref("")
    const loading = ref(true)
    const getDogUrl = async ()=>{
        const result = await axios.get("https://dog.ceo/api/breeds/image/random")
        loading.value = false
        dogUrl.value = result.data.message
    }
    onMounted(async ()=>{
        await getDogUrl()
    })
    return {dogUrl,loading}
}